import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import 'bootstrap'
import $ from 'jquery'
import 'element-ui/lib/theme-chalk/display.css';
import axios from './http'
import 'bootstrap'
import vueFilter from './filter/date.js'
import animated from 'animate.css'
for (let key in vueFilter) {
  Vue.filter(key, vueFilter[key])
}

Vue.use(animated)
Vue.use(ElementUI);
Vue.prototype.$axios = axios
Vue.config.productionTip = false

//对需要登录权限的页面进行拦截
router.beforeEach((to, from, next) => {
  if (to.meta.requireAuth) {
    if (localStorage.getItem('MyToken')) {
      next();
    }
    else {
      next({
        path: 'login',
      })
    }
  }
  else {
    next();
  }
})

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')

